﻿<local:DocumentBase x:Class="WPFExcelReport.JLTAV37"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"                    
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"                     
                    FontSize="12"
                    Loaded="Window_Loaded"
>
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter x:Key="Trim"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetEnv" />
        <db:SETINTEXDB  x:Key="SetProd" />
        <db:SETINTEXDB  x:Key="SetVKK" />
        <db:SETINTEXDB  x:Key="SetVKP" />
        <CollectionViewSource   x:Key="vwMKRF" Source="{Binding Path=ICC_MKRF,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwBMKRF" Source="{Binding Path=ICC_MKRF,Source={StaticResource SetEnv}}" />
        <CollectionViewSource   x:Key="vwFMKRF" Source="{Binding Path=FMKRF,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwVKPMKRF" Source="{Binding Path=VKPMKRF,Source={StaticResource SetVKP}}" />
        <CollectionViewSource   x:Key="vwVKKMKRF" Source="{Binding Path=VKKMKRF,Source={StaticResource SetVKK}}" />
        <CollectionViewSource   x:Key="vwABPOS" Source="{Binding Path=ABPOS,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwAMSTAMM" Source="{Binding Path=AMSTAMM,Source={StaticResource SetEnv}}" />
    </local:DocumentBase.Resources>
    <TabControl>
        <TabItem Header="细纱排产" GotFocus="TabItem_GotFocus">
            <DockPanel>
                <Expander Header="{Binding Source={Localization:TranslateExtension Word=生产单列表}}" ExpandDirection="Up" DockPanel.Dock="Bottom" IsExpanded="True"
                          MaxHeight="200">
                    <DataGrid  
                          CanUserReorderColumns="True"  
                          FontSize="12"
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwBMKRF}}"  x:Name="dlgABP" 
                  >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABKKDAUFTNR}" Header="{Binding Source={Localization:TranslateExtension Word=任务书}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=纱线}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFKRS}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFTP, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=分批}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAFOLGE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=步骤}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAGANG}" Header="{Binding Source={Localization:TranslateExtension Word=操作}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFMNRKRS}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFMLFDNR}" Header="{Binding Source={Localization:TranslateExtension Word=加工设备}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFMPOS}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFSOLLMG, Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:TranslateExtension Word=数量}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFSOLLSTART}" Header="{Binding Source={Localization:TranslateExtension Word=计划开始}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFSOLLDAT}" Header="{Binding Source={Localization:TranslateExtension Word=完成}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBNRKRS}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=排产染台}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFPLDATV}" Header="{Binding Source={Localization:TranslateExtension Word=排产开始}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFPLTIME}" Header="{Binding Source={Localization:TranslateExtension Word=时间}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFMASCHZT, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:TranslateExtension Word=加工时间}}"  Width="Auto" />
                        </DataGrid.Columns>
                    </DataGrid  >
                </Expander>
                <Expander Header="{Binding Source={Localization:TranslateExtension Word=分组}}" ExpandDirection="Left" DockPanel.Dock="Right" IsExpanded="True"
                          MaxWidth="300">
                    <ex:AniScrollViewer  
                                     HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                        <StackPanel >
                            <TextBlock>同色号</TextBlock>
                            <DataGrid  
                        CanUserReorderColumns="True"  
                        MaxHeight="200"
                        FontSize="12"
                        CanUserResizeRows="True" CanUserSortColumns="True"                  
                        AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwFMKRF}}"   
                  >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFPLDATV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=计划日期}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=染台}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" />
                                </DataGrid.Columns>
                            </DataGrid  >

                            <TextBlock>同品种</TextBlock>
                            <DataGrid  
                          CanUserReorderColumns="True"  
                          FontSize="12"
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                        MaxHeight="200"
                        
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKPMKRF}}"  
                  >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFPLDATV}" Header="{Binding Source={Localization:TranslateExtension Word=计划日期}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:TranslateExtension Word=任务书}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=花型}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=纱线}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS}" Header=" "  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=染台}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBPOS}" Header=""  Width="Auto" />
                                </DataGrid.Columns>
                            </DataGrid  >

                            <TextBlock>同任务书</TextBlock>
                            <DataGrid  
                          CanUserReorderColumns="True"  
                          FontSize="12"
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKKMKRF}}"   
                            MaxHeight="300"
                  >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFPLDATV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=计划日期}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:TranslateExtension Word=任务书}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=花型}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=纱线}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=染台}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" />
                                </DataGrid.Columns>
                            </DataGrid  >
                        </StackPanel>
                    </ex:AniScrollViewer>
                </Expander>
                <StackPanel DockPanel.Dock="Top" >
                    <WrapPanel>

                        <Button  Width="30" Height="30" Margin="10,0,0,0"  Click="btnRefresh_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/Refresh.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=更新}}"></TextBlock>
                        <Button  Width="30" Height="30"   Margin="10,0,0,0"  Click="btnSchedule_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/memory.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock  FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=排产}}"></TextBlock>

                        <TextBlock   Width="Auto"  Margin="10,0,0,0" Text="加工中心"  VerticalAlignment="Center"/>
                        <TextBox Background="White"   Width="40" Name="txtKSTKRS" CharacterCasing="Upper" Margin="10,0,0,0" Text="  "  VerticalAlignment="Center"/>
                        <TextBox Background="White"   Width="80" Name="txtFKST"   Margin="10,0,0,0" Text="0210"  VerticalAlignment="Center"/>
                        <TextBox Background="White"   Width="40" Name="txtAGANG"   Margin="10,0,0,0" Text="XS"  VerticalAlignment="Center"/>
                        <TextBox Background="White"   Width="40" Name="txtMachTyp"   Margin="10,0,0,0" Text="XS"  VerticalAlignment="Center"/>
                        <TextBlock   Width="Auto"  Margin="0,0,0,0" Text="染台"  VerticalAlignment="Center"/>
                        <ComboBox  ItemsSource="{Binding Source={StaticResource ResourceKey=vwAMSTAMM}}"
                                   Margin="10,0,0,0"  FontSize="18"
                                   SelectionChanged="AM_SelectionChanged"
                                   Background="White"  MinWidth="100" 
                                   DisplayMemberPath="AMBEZ"
                                   IsEditable="True"
                                   VerticalAlignment="Center"
                                   SelectedValuePath="AMBEZ"
                       />
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock   Width="Auto"  Margin="0,0,0,0" Text="生产单" />
                        <TextBox Background="White"  Width="30" Name="txtABPAUFKRS" CharacterCasing="Upper" Margin="5,0,0,0" Text="" />
                        <TextBox Background="White"  Width="80" Name="txtABPAUFLFD"   Margin="5,0,0,0" Text="" />
                        <TextBox  Background="White"  Width="40" Name="txtABPAUFPOS"   Margin="5,0,0,0" Text="" />
                        <Button Content="查找"   Margin="10,0,0,0" Width="Auto" Click="btnSearch_Click"/>
                    </WrapPanel>
                    <WrapPanel Visibility="Collapsed">
                        <TextBlock  Background="White"  Width="40" Text="{Binding Path=MKFSMG5, Source={StaticResource ResourceKey=vwBMKRF},Converter={StaticResource ResourceKey=d100}}" Margin="5,0,0,0"  />
                        <TextBox  Background="White"  Width="40" Name="txtSplitQty"   Margin="5,0,0,0" Text="0" />
                        <Button Content="拆分"   Margin="10,0,0,0" Width="Auto" Click="btnSplit_Click"/> 
                    </WrapPanel>
                </StackPanel>
                <ex:AniScrollViewer Name="mainViewer"  
                                     HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                    <StackPanel Name="machines" >
                    </StackPanel>
                </ex:AniScrollViewer>
            </DockPanel>
        </TabItem>
        <TabItem Name="tabMS" Header="手工排单" GotFocus="tabMS_GotFocus"  >
            <DockPanel>
                <StackPanel  DockPanel.Dock="Top" >
                    <WrapPanel>
                        <Button  Margin="0,0,0,0" Content="清除筛选" Click="btnClear_Click" />
                        <Button  Margin="0,0,0,0" Content="筛选" Click="btnFilter_Click" />
                        <TextBlock Margin="10,0,0,0" Text="仅未确认"  VerticalAlignment="Center"/>
                        <CheckBox Name="chkS" VerticalAlignment="Center" Margin="10,0,0,0"></CheckBox>
                        <TextBlock Margin="10,0,0,0" Text="生产单" />
                        <TextBlock Background="LightGray"     Width="20" Margin="1,0,0,0" Text="{Binding ABFAUFKRS, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBlock Background="LightGray"    Width="60" Margin="1,0,0,0" Text="{Binding ABFAUFLFD, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBlock  Background="LightGray"   Width="30"   Margin="1,0,0,0" Text="{Binding ABFAUFPOS, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBlock Margin="10,0,0,0" Text="染台" />
                        <TextBox Background="White" BorderBrush="Black"    Width="20" Margin="1,0,0,0" Text="{Binding ABFBNRKRS, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBox Background="White"  BorderBrush="Black"   Width="60" Margin="1,0,0,0" Text="{Binding ABFBLFDNR, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBox  Background="White"  BorderBrush="Black"  Width="30"   Margin="1,0,0,0" Text="{Binding ABFBPOS, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBlock Margin="10,0,0,0" Text="日期" />
                        <TextBox  Background="White"  BorderBrush="Black"  Width="80"   Margin="1,0,0,0" Text="{Binding MKFPLDATV, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBlock Margin="10,0,0,0" Text="时间" />
                        <TextBox  Background="White"  BorderBrush="Black"  Width="80"   Margin="1,0,0,0" Text="{Binding MKFPLTIME, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBlock Margin="10,0,0,0" Text="班次" />
                        <TextBox  Background="White"  BorderBrush="Black"  Width="30"   Margin="1,0,0,0" Text="{Binding MKFSCHICHTV, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <Button Height="30" Width="30"      Margin="10,0,0,0"  Click="btnConfirmSchedule_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/button_ok.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock  FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=确认}}"></TextBlock>
                    </WrapPanel>
                </StackPanel>
                <Expander Header="{Binding Source={Localization:TranslateExtension Word=分组}}" ExpandDirection="Left" DockPanel.Dock="Right" IsExpanded="True"
                          MaxWidth="400">
                    <ex:AniScrollViewer  Name="reference"
                                     HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                        <StackPanel >
                            <TextBlock>同色号</TextBlock>
                            <DataGrid  
                                CanUserReorderColumns="True"  
                                MaxHeight="200"
                                FontSize="12"
                                CanUserResizeRows="True" CanUserSortColumns="True"                  
                                AutoGenerateColumns="False"   
                                EnableRowVirtualization="True"  
                                RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwFMKRF}}"   
                                >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFPLDATV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=计划日期}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=染台}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" />
                                </DataGrid.Columns>
                            </DataGrid  >

                            <TextBlock>同品种</TextBlock>
                            <DataGrid  
                          CanUserReorderColumns="True"  
                          FontSize="12"
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                        MaxHeight="200"
                        
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKPMKRF}}"  
                  >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFPLDATV}" Header="{Binding Source={Localization:TranslateExtension Word=计划日期}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:TranslateExtension Word=任务书}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=花型}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=纱线}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=染台}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBPOS}" Header=""  Width="Auto" />
                                </DataGrid.Columns>
                            </DataGrid  >

                            <TextBlock>同任务书</TextBlock>
                            <DataGrid  
                          CanUserReorderColumns="True"  
                          FontSize="12"
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKKMKRF}}"   
                            MaxHeight="300"
                  >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFPLDATV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=计划日期}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:TranslateExtension Word=任务书}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=花型}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=纱线}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=染台}}"  Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header=""  Width="Auto" />
                                </DataGrid.Columns>
                            </DataGrid  >
                        </StackPanel>
                    </ex:AniScrollViewer>
                </Expander>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1*"></RowDefinition>
                        <RowDefinition Height="2*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <ex:AniScrollViewer Name="scheduler" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
                        <StackPanel  Name="ListMachineJob" >
                        </StackPanel>
                    </ex:AniScrollViewer>
                    <DataGrid  Grid.Row="1"
                               Grid.Column="0" Grid.ColumnSpan="4"
                          CanUserReorderColumns="True"  
                          FontSize="12"
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True"  Visibility="Visible"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwBMKRF}}"  x:Name="dlgMABP" 
                  >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABKKDAUFTNR}" Header="{Binding Source={Localization:TranslateExtension Word=任务书}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=纱线}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFKRS}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAFOLGE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=步骤}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFAGANG}" Header="{Binding Source={Localization:TranslateExtension Word=操作}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFSOLLMG, Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:TranslateExtension Word=数量}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFSOLLSTART}" Header="{Binding Source={Localization:TranslateExtension Word=计划开始}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFSOLLDAT}" Header="{Binding Source={Localization:TranslateExtension Word=完成}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBNRKRS}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=排产染台}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFPLDATV}" Header="{Binding Source={Localization:TranslateExtension Word=排产开始}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFPLTIME}" Header="{Binding Source={Localization:TranslateExtension Word=时间}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFMASCHZT, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:TranslateExtension Word=加工时间}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFMNRKRS}" Header=" "  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFMLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=加工染台}}"  Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ABFMPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                        </DataGrid.Columns>
                    </DataGrid  >
                </Grid>
            </DockPanel>
        </TabItem>
        <TabItem Header="打印输出">
            <DockPanel>
                <StackPanel  DockPanel.Dock="Top" >
                    <WrapPanel>
                        <Button  Margin="0,0,0,0" Content="清除筛选" Click="btnSClear_Click" />
                        <Button  Margin="0,0,0,0" Content="筛选" Click="btnSFilter_Click" />
                        <TextBlock Margin="10,0,0,0" Text="仅未确认"  VerticalAlignment="Center"/>
                        <TextBlock Margin="10,0,0,0" Text="染台" />
                        <TextBox Background="White" BorderBrush="Black"    Width="20" Margin="1,0,0,0" Text="{Binding ABFBNRKRS, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBox Background="White"  BorderBrush="Black"   Width="60" Margin="1,0,0,0" Text="{Binding ABFBLFDNR, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBox  Background="White"  BorderBrush="Black"  Width="30"   Margin="1,0,0,0" Text="{Binding ABFBPOS, Source={StaticResource ResourceKey=vwBMKRF}}" />
                        <TextBlock Margin="10,0,0,0" Text="日期至" />
                        <TextBox  Background="White"  BorderBrush="Black"  Width="80"   Margin="1,0,0,0" Name="txtDate" />
                        <Button Height="30" Width="30"      Margin="10,0,0,0"  Click="btnPrint_Click">
                            <Button.Background>
                                <ImageBrush  ImageSource="Image/Print.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock  FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=打印}}"></TextBlock>
                    </WrapPanel>
                </StackPanel>
                <DataGrid  Grid.Row="1"
                               Grid.Column="0" Grid.ColumnSpan="4"
                          CanUserReorderColumns="True"  
                          FontSize="12"
                          CanUserResizeRows="True" CanUserSortColumns="True"                  
                          AutoGenerateColumns="False"   
                          EnableRowVirtualization="True"  
                          RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                          IsSynchronizedWithCurrentItem="True"  Visibility="Visible"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwBMKRF}}"  x:Name="dlgSABP" 
                  >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=SPCONFIRM, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:TranslateExtension Word=确认}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABKKDAUFTNR}" Header="{Binding Source={Localization:TranslateExtension Word=任务书}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPART}" Header="{Binding Source={Localization:TranslateExtension Word=纱线}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:TranslateExtension Word=色号}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAUFKRS}" Header=" "  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAUFPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAFOLGE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=步骤}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFAGANG}" Header="{Binding Source={Localization:TranslateExtension Word=操作}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFSOLLMG, Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:TranslateExtension Word=数量}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFSOLLSTART}" Header="{Binding Source={Localization:TranslateExtension Word=计划开始}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFSOLLDAT}" Header="{Binding Source={Localization:TranslateExtension Word=完成}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFBNRKRS}" Header=" "  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFBLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=排产染台}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFBPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=MKFPLDATV}" Header="{Binding Source={Localization:TranslateExtension Word=排产开始}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=MKFPLTIME}" Header="{Binding Source={Localization:TranslateExtension Word=时间}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=MKFSCHICHTV}" Header="{Binding Source={Localization:TranslateExtension Word=班次}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFMASCHZT, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:TranslateExtension Word=加工时间}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFMNRKRS}" Header=" "  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFMLFDNR, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=加工染台}}"  Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ABFMPOS, Converter={StaticResource ResourceKey=pnum}}" Header=" "  Width="Auto" />
                    </DataGrid.Columns>
                </DataGrid  >

            </DockPanel>
        </TabItem>
    </TabControl>
</local:DocumentBase>
